package com.hxiaoyi.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 修改Ribbon的负载规则
 * @author 黄敬意
 * @date 2022-02-05 23:11
 **/
@Configuration
public class MySelfRule {

    /**修改为随机规则*/
    @Bean
    public IRule myRule() {
        return new RandomRule();
    }
}
